<template>

    <h1>列表</h1>

    <p v-for="(item, index) in names" :key="item"> {{ item }} - {{ index }}</p>

    <p v-for="(item, index) of names"> {{ item }} - {{ index }}</p>

    <div v-for="item in result">

        <p>{{ item.name }}</p>
        <p>{{ item.age }}</p>


    </div>


</template>



<script>

export default {

    data() {
        return {
            names: ["测试1", "测试2"],
            result: [{ name: "测试1", "age": 12 }, { name: "测试2", "age": 32 }, { name: "测试3", "age": 22 }]
        }
    }

}

</script>
